<?php
namespace app\web\validate;

use think\Validate;


class MinusValidate extends Validate {

    /**
     * 字段验证规则提示
     *
     * @var array
     */
    protected $rule  =   [
        'id'      => 'require|number',
        'name'      => 'require|max:100',
        'sort'      => 'number',
        'type_ed'   =>'require|number|between:1,2',
        'amount'    =>'require|number',
        'number'    =>'require|number',
        'type'      =>'require|number|between:1,2',
        'range_start'    =>'require|number',
        'range_end'    =>'require|number',
        'hand_card_type'    =>'require',
        'computer_type'    =>'require|number|between:1,2',
    ];


    /**
     * 字段验证规则
     *
     * @var array
     */
    protected $message = [
        'id.require'=>  'ID必填',
        'sort.number'=>  '排序必填',
        'name.require' => '名称必填',
        'name.max'     => '名称最多不能超过100个字符',
        'type.require'   => '减免的方式必填',
        'type.number'   => '减免的方式必须是数字',
        'type.between'   => '减免的方式只能在1-2之间',
        'type_ed.number'    => '被减免的方式必须是数字',
        'type_ed.between'  => '被减免的方式只能在1-2之间',
        'number.number'    => '共减免必须是数字',
        //'range_start.number'    => '减免消费要求最小值必须是数字',
        //'range_end.number'    => '减免消费要求最大值必须是数字',
        'hand_card_type.require'    => '手牌类型必填',
        'computer_type.number'    => '计算方式必须是数字',
    ];


    protected $scene = [
        'add'=>['sort','name','type','type_ed','number','hand_card_type','computer_type'],
        'edit'=>['id','sort','name','type','type_ed','number','hand_card_type','computer_type'],
    ];




}